{extend name="public:base" /}
{block name="content"}
<div class="page-header">
	<h1>	
		{$breadcrumb1}
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			{$breadcrumb2}
		</small>
	</h1>
</div>	
	
<div class="row">
	<div class="col-xs-12">	
		<div class="table-responsive">
			<table class="table table-striped table-bordered table-hover">
				<thead>
					<tr>
						<td>模块</td> 
						<td>模块名称</td> 	
						<td>依赖的模块</td> 	
						<td>作者</td>	
						<td>描述</td>
						<td>状态</td>
						<td>操作</td>				
					</tr>
				</thead>
				<tbody>
						
				{volist name="list" id="module" empty="$empty"}
					<tr>
						<td>{$module.module}</td>
						<td>{$module.modulename}</td>
						<td>{$module.base_module}</td>
						<td>{$module.author}</td>
						<td>{$module.description}</td>
						<td>
							{switch name="module.disabled"}
								{case value="1"}<span class="green">已经安装</span> {/case}
								{case value="0"}<span class="red">未安装</span>{/case}
							{/switch}
						</td>
						<td>
							{switch name="module.disabled"}
								{case value="1"}<a title="点击卸载" href='{$Request.root.true}/{$module.module}/install/uninstall'><span id="{$module.module}" class="del btn btn-xs btn-danger"><i class="fa fa-minus-circle bigger-120"></i></span></a>{/case}								
								{case value="0"}<a title="点击安装" href='{$Request.root.true}/{$module.module}/install/install'><span class="btn btn-xs btn-success"><i class="fa fa-plus-circle bigger-120"></i></span></a>{/case}							
							{/switch}
						</td>
					</tr>
				{/volist}
						
				</tbody>
				
			</table>
		</div>
	</div>
</div>
{/block}
{block name="javascript"}
<script>
$('.del').click(function(){
	var module=$(this).attr('id');		
	
	var info='确认要执行该操作吗？';
	
	if(module=='member'){
		info='该操作将删除用户数据，订单数据，确认要执行该操作吗？';
	}
	if(module=='mobile'){
		info='该操作将删除代理商数据，自动回复数据，确认要执行该操作吗？';
	}
	
	var f=confirm(info);
	if(f==false){
		return false;
	}
			
});
</script>							
{/block}
